package pl.planito.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the inventory database table.
 * 
 */
@Entity
@Table(name="inventory")
public class Inventory implements Serializable {
	private static final long serialVersionUID = 1L;

	@EmbeddedId
	private InventoryPK id;

	@Column(name="created_by")
	private String createdBy;

    @Lob()
	private String description;

	private String name;

	private int version;

	//bi-directional many-to-one association to InvHardware
	@OneToMany(mappedBy="inventory")
	private List<InvHardware> invHardwares;

	//bi-directional many-to-one association to InvSoftware
	@OneToMany(mappedBy="inventory")
	private List<InvSoftware> invSoftwares;

	//bi-directional many-to-one association to Company
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="fk_company_id")
	private Company company;

	//bi-directional many-to-one association to Type
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="fk_type_id")
	private Type type;

	//bi-directional many-to-one association to User
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="borrowed_by")
	private User user;

    public Inventory() {
    }

	public InventoryPK getId() {
		return this.id;
	}

	public void setId(InventoryPK id) {
		this.id = id;
	}
	
	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getVersion() {
		return this.version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	public List<InvHardware> getInvHardwares() {
		return this.invHardwares;
	}

	public void setInvHardwares(List<InvHardware> invHardwares) {
		this.invHardwares = invHardwares;
	}
	
	public List<InvSoftware> getInvSoftwares() {
		return this.invSoftwares;
	}

	public void setInvSoftwares(List<InvSoftware> invSoftwares) {
		this.invSoftwares = invSoftwares;
	}
	
	public Company getCompany() {
		return this.company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}
	
	public Type getType() {
		return this.type;
	}

	public void setType(Type type) {
		this.type = type;
	}
	
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
}